home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Tele
/
C
/
Comet2.1.3.cpt
/
include
/
timer.h
< prev
next >
Wrap
Text File
|
1990-01-31
|
1KB
|
54 lines
/* Copyright 1983 by the Massachusetts Institute of Technology */
/*
Copyright Cornell University 1986. All rights are reserved.
As of 4/10/86:
This source file may have no changes from the M.I.T original
other than this notice; but it has been tested as part of
Cornell's Aztec-C port. See notice.h
*/
/* timer.h */
#ifndef _TIMERDEF
#define _TIMERDEF
#include <q.h>
/*
This file contains the declarations for the timer management package.
*/
#define TPS 60 /* Clock ticks per second. */
typedef unsigned nonce; /* a timeout nonce */
typedef struct timer /* a timer */
{
struct q_elt tm_elt; /* next element in lwa-queue */
unsigned long tm_time; /* time the timer expires */
nonce tm_nonce; /* nonce for this timer */
int (*tm_subr) (); /* subroutine to call on timeout */
char *tm_arg; /* arg to pass to subr */
} timer;
typedef struct time_q /* the lwa-queue of active timers */
{
timer *tmq_head; /* head of the timer lwa-queue */
timer *tmq_tail; /* tail of the timer lwa-queue */
int tmq_len; /* number of elements in lwa-queue */
unsigned tmq_max;
unsigned tmq_min;
} time_q;
timer *tm_alloc();
extern unsigned TIMERDEBUG;
extern char timertripped; /* timer needs attention under MacTCP */
#endif